package com.broadengate.view.controller;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.broadengate.bean.DepartmentInfo;
import com.broadengate.service.DepartmentService;



/**
 * 部门管理
 * 
 * @author 木子传
 *
 */
@Controller
@RequestMapping("/DepartmentController")
public class DepartmentController
{
    private final static Logger log = Logger.getLogger(LoginController.class);
    
    @Autowired
    private DepartmentService departmentService;
    
    
    /**
     * 获取完整部门结构树
     * 此方法用于返回一个满足TreeGriad的JSON对象
     * @return [参数说明]
     * 
     * @return List<OragnizationInfo> [返回类型说明]
     * @exception throws [违例类型] [违例说明]
     * @see [类、类#方法、类#成员]
     */
    @RequestMapping("/departmentTree")
    @ResponseBody
    public List<DepartmentInfo> departmentTree()
    {
        return departmentService.getDepartmentById(0);
    }
    
    
}
